import Vue from 'vue'
// 导入全局注册的指令注册为插件
import Directive from '@/directive/index.js'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'

// 导入插件-注册全局组件
import MyCompoent from '@/components/index'

import 'element-ui/lib/theme-chalk/index.css'
// 设置语言为中文
import locale from 'element-ui/lib/locale/lang/zh-CN.js'
// 导入多语言包
import i18n from '@/lang'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */

// set ElementUI lang to EN
Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)

// 导入插件-注册全局组件
Vue.use(MyCompoent)

// 全局指令注册为插件
Vue.use(Directive)

Vue.config.productionTip = false

/* // Vue.use()基本使用
const obj = {
  install(Vue) {
    alert('我是obj')
  }
}
Vue.use(obj) */

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})
